import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CrmListComponent } from './crm-list/crm-list.component';
import { CrmAddComponent } from './crm-add/crm-add.component';
import { RouterModule, Routes } from '@angular/router';
import { getNgRoute } from '@ds/ds-micro/dist';
import { isMicro } from '@ds/ds-micro-lib/dist';
import { EmptyComponent, EmptyModule } from '../empty.component';



const routes: Routes = [
  {
    path: '',
    component: CrmListComponent,
  },
  {
    path: 'list',
    component: CrmListComponent,
  },
  {
    path: 'add',
    component: CrmAddComponent,
  },
];

// 可做子应用界面
const data = {
  CrmListComponent,
  CrmAddComponent,
  '__empty': EmptyComponent,
}


console.log('懒加载情况使用')

@NgModule({
  declarations: [CrmListComponent, CrmAddComponent],
  imports: [
    CommonModule,
    EmptyModule,
    RouterModule.forChild(!isMicro ? routes:  getNgRoute('customer', data, 'SellCrmModule')),
  ]
})
export class SellCrmModule { }
